/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package sonia.golf.dao.sqlite;

//~--- non-JDK imports --------------------------------------------------------

import android.content.Context;

import sonia.golf.dao.ConfigDAO;
import sonia.golf.dao.CourseDAO;
import sonia.golf.dao.DAOFactory;
import sonia.golf.dao.PlayerDAO;

/**
 *
 * @author Sebastian Sdorra
 */
public class SQLiteDAOFactory extends DAOFactory
{

  /**
   * Method description
   *
   *
   * @param context
   */
  @Override
  public void close(Context context)
  {
    sqliteHelper.close();
  }

  /**
   * Method description
   *
   *
   * @param context
   */
  @Override
  public void init(Context context)
  {
    sqliteHelper = new SQLiteHelper(context);
    playerDAO = new SQLitePlayerDAO(sqliteHelper);
    courseDAO = new SQLiteCourseDAO(sqliteHelper);
  }

  //~--- get methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  public ConfigDAO getConfigDAO()
  {
    throw new UnsupportedOperationException("Not supported yet.");
  }

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  public CourseDAO getCourseDAO()
  {
    return courseDAO;
  }

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  public PlayerDAO getPlayerDAO()
  {
    return playerDAO;
  }

  //~--- fields ---------------------------------------------------------------

  /** Field description */
  private SQLiteCourseDAO courseDAO;

  /** Field description */
  private SQLitePlayerDAO playerDAO;

  /** Field description */
  private SQLiteHelper sqliteHelper;
}
